import { createApp } from "vue";
import { MessageEventListener } from "@/utils/functions";
import App from "./App.vue";
import router from "./router";

import MatDesignUI from "~/index"; // 开发
import "~/styles/index.less"; // 开发

/* eslint-disable */
import { mockXHR } from "../__mocks__";

/* import MatDesignUI from "../lib"; // 测试
import "../lib/styles/index.css"; // 测试 */

mockXHR();

const app = createApp(App);
app.use(MatDesignUI);
app.use(router);
app.mount("#site-app");
// 接收数据
MessageEventListener((path) => {
  app.config.globalProperties.$router.push({
    path
  });
});
